<?php

class staticActions extends sfActions
{
  public function executeIndex()
  {
    $this->content = $this->getRequestParameter('content');

    $context = $this->getContext();

    $this->forward404Unless($this->partialExists($context, $this->content));
  }

  protected function partialExists($context, $name)
  {
    $directory = $context->getModuleDirectory();

    return (is_readable($directory . DIRECTORY_SEPARATOR . "templates" . DIRECTORY_SEPARATOR . "_" . $name . ".php"));
  }
  
  public function executeGmap()
  {
    //Testing Phoogle Map API
    $this->gmap = new PhoogleMap();
    $this->gmap->setAPIkey(sfConfig::get('app_gmapkey'));
    $this->gmap->setWidth('480');
    $this->gmap->setHeight('320');
    $this->gmap->controlType = 'large';
    $this->gmap->addAddress('11 Athlone Way, Maryland, NSW, Australia');
  }
}
